{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Get the intermediate data\n",
    "\n",
    "DataPrep.EDA separates the computation and rendering, so that you can just compute the intermediate data and render it using other plotting libraries. \n",
    "\n",
    "For each `plot` function, there is a corresponding `compute` function, which returns the computed intermediates used for rendering. For example, for `plot` function, you can get the intermediates. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from dataprep.eda import compute\n",
    "from dataprep.datasets import load_dataset\n",
    "df = load_dataset(\"titanic\")\n",
    "compute(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get the intermediate data via `config`\n",
    "\n",
    "For plot_correlation(df) function, you can get the intermediates. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from dataprep.eda import compute_correlation\n",
    "from dataprep.datasets import load_dataset\n",
    "df = load_dataset(\"titanic\")\n",
    "imdt = compute_correlation(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get the intermediate data via `config`\n",
    "\n",
    "For plot_missing(df) function, you can get the intermediates using compute_missing(df). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from dataprep.eda import compute_missing\n",
    "from dataprep.datasets import load_dataset\n",
    "df = load_dataset(\"titanic\")\n",
    "imdt_miss = compute_missing(df, \"Age\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get the intermediate data via `config`\n",
    "\n",
    "For create_report(df) function, you can get the intermediate report using format_report(df). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from dataprep.eda.configs import Config\n",
    "from dataprep.eda.create_report import format_report\n",
    "from dataprep.datasets import load_dataset\n",
    "df = load_dataset(\"titanic\")\n",
    "cfg = Config.from_dict()\n",
    "format_report(df, cfg = cfg, mode = \"basic\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
